'use strict';

var Koa=require('koa');
var templating=require('./templating');
var controllers=require('./controllers');
var stat=require('koa-static');
var bodyparser=require('koa-bodyparser');
let model=require('./models');
let session=require('./session')


var app=new Koa();
app.use(session(app));

app.use(stat(__dirname+'/stat'));

app.use(bodyparser());

app.use(templating);

app.use(controllers());

(async ()=>{
    console.log('正在初始化数据表。。。');
    //await model.sync();
})();


var port=8010;
app.listen(port);
console.log(`IP:http://127.0.0.1:${port}`); 